<%@page import="cn.sendto.mapper.IRowMapper"%>
<%@page import="cn.sendto.dbhelper.DBHelper"%>
<%@page import="cn.sendto.mapper.*" %>
<%@page import="cn.sendto.model.*" %>
<%@page import="java.util.List" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@include file="getSession.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="css/global.css"/>
		<title>科目名称</title>
		<style type="text/css">
		.form{
			width: 60%;
			text-align: center;
			margin: 0 auto;
			font-size: 18px;
			line-height: 30px;
			
		}	
		.text{
			width: 60%;
			height: 40px;
		}
		
		.cou{
			margin-top: 15%;
			line-height: 40px;
		}
		</style>
	</head>
	<%
	   //设置编码
	    request.setCharacterEncoding("UTF-8");
	    
	    //取得要修改ID值
	    String id = request.getParameter("id");
	    
	    //实例化操作数据库的类
	    DBHelper helper= new DBHelper();
	    
	    //定义SQL语句
	    String sql ="select * from courseinfo where courseid=?";
	    
	    
	    IRowMapper<CourseEntity> mapper = new CourseMapper();
	    
	    List<CourseEntity> list = helper.executeQuery(sql, mapper, id);
	    
	   if(list!=null && list.size()>0)
	  {
	
	%>
	<body>
	<%
	 if(request.getAttribute("info")!=null){
	  %>
	   <script type="text/javascript">
	    alert("<%=request.getAttribute("info")%>");
	   </script>
	  <%} %>
		<div class="form">
			<form action="domodifycourse.jsp" method="post">
				<div class="cou">
					<span>科目名称：</span><input name="coursename" class="text" type="text" value="<%=list.get(0).getCourseName()%>" />
				</div>
				<br />
				<br />
			    <input type="hidden" name="courseid" value="<%=id %>" />
				<input class="subm" type="submit" value="添加"/>
			</form>
				
		</div>
	</body>
	<%
	}
else 
 out.print("对不起，操作异常。");
%>
</html>
